﻿using System.Threading;
using Ledict.ConditionExtract.Common;
using Ledict.Utility.Frm;

namespace Ledict.ConditionExtract.BLL.WorkProcess
{
    public class WorkThread
    {
        protected ManualResetEvent lockObj = new ManualResetEvent(true);
        protected bool readyToClose;
        public ProcessShow processShow;   //进度显示更新
        public CloseForm closeForm;   //关闭

        public DataSourceCondition conditon;

        /// <summary>
        /// Lucene查询方法（WCF或直接通过共享方法调用）
        /// </summary>
        public string LuceneSearchType { get; set; }

        #region 继续暂停
        /// <summary>
        /// 开始
        /// </summary>
        public void Resume()
        {
            bool a = lockObj.Set();//开始
        }
        /// <summary>
        /// 暂停
        /// </summary>
        public void Suspend()
        {
            bool a = lockObj.Reset();//使阻塞
        }
        /// <summary>
        /// 关闭
        /// </summary>
        public void Stop()
        {
            readyToClose = true;
            lockObj.Set();
        }
        #endregion

        /// <summary>
        /// 
        /// </summary>
        public virtual void execute_Start()
        {

        }

        public virtual void execute_Start(DataSourceCondition condition)
        {
        }











    }
}
